<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class InitUpdate46 extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('boxes', function (Blueprint $table) {
            $table->integer('open_index')->default(0)->comment('已开序号次数'); // 用户id
        });

        Schema::table('box_skus', function (Blueprint $table) {
            $table->json('open_indexs')->nullable()->comment('已开序号次数数组集合'); // 用户id
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('boxes', function (Blueprint $table) {
            $table->dropColumn(['open_index']);
        });

        Schema::table('box_skus', function (Blueprint $table) {
            $table->dropColumn(['open_indexs']);
        });
    }
}
